﻿@{
    ViewBag.Title = "MyPictures";
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#demo").wijgrid({
            allowSorting: true,
            allowPaging: true,
            allowColMoving: true,
            pageSize: 10,
            data: new wijdatasource({
                proxy: new wijhttpproxy({
                    url: "@Url.Content("~/Manager/GetList")",
                    dataType: "json",
                    data: {
                        featureClass: "P",
                        style: "full",
                        maxRows: 12,
                        name_startsWith: 'ab'
                    }
                }),
                reader: new wijarrayreader([
                     {
                         name: "用户ID",
                         mapping: function (item) {
                             return aaa();
                         }
                     },
                     { name: "姓名", mapping: "姓名" }
                ])
            }),
            //columns: [
            //        { headerText: "姓名11" }, { headerText: "用户ID" }, { headerText: "用户ID" }
            //],
            loadingText: "正在载入...",
            nullString: ""
        });

        function aaa() {
            var aaa;
            $.ajax({
                type: "get",
                url: "@Url.Content("~/Manager/AAA")",
                data: { aaa: "John" },
                async: false,
                success: function (data) {
                    aaa = data;
                }
            });
            return aaa;
        };
    });

    function abc() {
        //var sc = $("#demo").wijgrid("selection").selectedCells();
        //for (var i = 0, len = sc.length() ; i < len; i++) {
        //    var cellInfo = sc.item(i);
        //    alert(cellInfo.value());
        //};
        var current = $("#demo").wijgrid("currentCell");
        alert($("#demo").wijgrid("currentCell").value());
    }
</script>

<div class="main demo">
    <a href="#" onclick="abc()">测试</a>
    <!-- Begin demo markup -->
    <table id="demo">
    </table>
    <!-- End demo markup -->
    <div class="demo-options">
        <!-- Begin options markup -->
        <!-- End options markup -->
    </div>
</div>
